<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page session="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TOP PITCH - View Pitch</title>
<link href="resources/css/common.css" rel="stylesheet" type="text/css" />
<link href="resources/css/pitch.css" rel="stylesheet" type="text/css" />
<link href="resources/css/left_nav.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="resources/jss/jquery-1.7.2.min.js" ></script>
<script type="text/javascript" src="resources/jss/pitch.js" ></script>
</head>
<body>
	<div class="main">
		<jsp:include page="header.inc.jsp"></jsp:include>
		
		<table>
			<tr>
				<c:choose>
					<c:when test="${ user.student }">
						<jsp:include page="student/leftNav.inc.jsp"></jsp:include>
					</c:when>
					<c:otherwise>
						<jsp:include page="hf/leftNav.inc.jsp"></jsp:include>
					</c:otherwise>
				</c:choose>
				<td class="rightcontent">
					<div class="pitchdetail">
						<div class="pitchinfo">
							<table>
								<tr>
									<td rowspan="7">
										<div class="photosmall">
											<img alt="" src="photo/${ author.photoId }">
										</div>
										<c:choose>
											<c:when test="${ user.student }">
												<c:choose>
													<c:when test="${ author.availableToPublic }">
												<div class="pitchauthor"><a href="profile?email=${ author.email }"><c:out value="${ author.firstName } ${ author.lastName }" /></a></div>
													</c:when>
													<c:otherwise>
												<div class="pitchauthor"><c:out value="${ author.firstName } ${ author.lastName }" /></div>
													</c:otherwise>
												</c:choose>
											</c:when>
											<c:otherwise>
												<c:choose>
													<c:when test="${ author.availableToHf }">
												<div class="pitchauthor"><a href="profile?email=${ author.email }"><c:out value="${ author.firstName } ${ author.lastName }" /></a></div>
													</c:when>
													<c:otherwise>
												<div class="pitchauthor"><c:out value="${ author.firstName } ${ author.lastName }" /></div>
													</c:otherwise>
												</c:choose>
											</c:otherwise>
										</c:choose>
									</td>
									<td class="pitchinfolabel">Company:</td>
									<td><c:out value="${ pitch.companyName } (${ pitch.companyTicker })" /></td>
								</tr>
								<tr>
									<td class="pitchinfolabel">Submitted On:</td>
									<td><c:out value="${ pitch.date }" /></td>
								</tr>
								<tr>
									<td class="pitchinfolabel">Recommendation:</td>
									<td><c:out value="${ pitch.recommendation }" /></td>
								</tr>
								<tr>
									<td class="pitchinfolabel">Expected Timeframe:</td>
									<td><c:out value="${ pitch.expectedTimeframe }" /></td>
								</tr>
								<tr>
									<td class="pitchinfolabel">Geography:</td>
									<td><c:out value="${ pitch.geography }" /></td>
								</tr>
								<tr>
									<td class="pitchinfolabel">Country:</td>
									<td><c:out value="${ pitch.country }" /></td>
								</tr>
								<tr>
									<td class="pitchinfolabel">Situation:</td>
									<td><c:out value="${ pitch.situation }" /></td>
								</tr>
								<c:if test="${ pitch.modelUploaded }">
								<tr>
									<td></td>
									<td class="pitchinfolabel">Model:</td>
									<td><a href="model/${ pitch.modelId }/${ pitch.modelFileName }" target="_blank">Download</a></td>
								</tr>
								</c:if>
							</table>
						</div>
						<div class="subtitle">Thesis</div>
						<div class="pitchcontent">
							${ thesis }
						</div>
						<div class="subtitle">Variant View</div>
						<div class="pitchcontent">
							${ variantView }
						</div>
						<div class="subtitle">Comments</div>
						<c:forEach var="comment" items="${ comments }">
						<div class="pitchcomment">
							<div class="pitchcommenttime"><c:out value="${ comment.postTimeString }" /></div>
							<div>
								<table>
									<tr>
										<td class="commentphotobox">
											<div class="photosmall">
												<img alt="" src="photo/${ comment.authorPhotoId }">
											</div>
											<c:choose>
												<c:when test="${ comment.authorAvailable }">
													<div class="pitchcommentauthor"><a href="profile?email=${ comment.authorEmail }">
													<c:out value="${ comment.authorName }" />
													</a></div>
												</c:when>
												<c:otherwise>
													<div class="pitchcommentauthor"><c:out value="${ comment.authorName }" /></div>
												</c:otherwise>
											</c:choose>
										</td>
										<td class="commentcontentbox">
											<div class="pitchcommentcontent">
												${ comment.commentText }
											</div>
										</td>
									</tr>
								</table>
							</div>
						</div>
						</c:forEach>
						<div class="subtitle">Add Comment</div>
						<div class="pitchaddcomment">
							<textarea id="addCommentTextInput" rows="5" cols="40" class="pitchcommentinput"></textarea>
						</div>
						<div>
							<input id="pitchIdInput" type="hidden" value="<c:out value="${ pitch.pitchId }" />" />
							<input id="addCommentButton" type="button" class="button" value="Submit" />
						</div>
					</div>
				</td>
			</tr>
		</table>
		
		
		<jsp:include page="footer.inc.jsp"></jsp:include>
	</div>
		<jsp:include page="copyright.inc.jsp"></jsp:include>
</body>
</html>
